Doors DXL Trigger firing with multiple Attributes

Hi everybody,

I'm trying to create a Trigger, that fires if one of multiple possible Attributes has been changed.

Trigger t = trigger(trigName,attribute->"Object Text",post,modify,10,triggerDxl)

This Trigger works fine for me, but i need a Trigger, that also fires if changes made at "Object Heading" for example.

I tried to change the level to :

Trigger t = trigger(trigName,attribute->"Object Text"->"Object Heading",post,modify,10,triggerDxl)

It does not throw a Syntax Error, but is does not work too.

Is there a chance to select just a few attributes instead of selecting all or create a Trigger for every attribute (i have round about 20 Attributes for this Trigger) ?

 

Cheers,

Arn


Dummy1337 - Wed Sep 17 04:44:24 EDT 2014

Re: Doors DXL Trigger firing with multiple Attributes
Wolfgang Uhr - Wed Sep 17 05:21:24 EDT 2014

Hi

Ok, the following trigger works?

Trigger t = trigger(trigName, attribute -> "Object Text", post, modifiy, 10, triggerDxl);

Then use

Trigger t1 = trigger(trigName, attribute -> "Object Text", post, modifiy, 10, triggerDxl1);
Trigger t2 = trigger(trigName, attribute -> "Object Heading", post, modifiy, 10, triggerDxl2);

Best regards
Wolfgang

Re: Doors DXL Trigger firing with multiple Attributes
Mike.Scharnow - Wed Sep 17 05:29:08 EDT 2014

Hello Arn,

 

We do it this way

T = trigger (triggerName, project->formal->attribute->all, pre, save, 5, triggerDxl)

and in the trigger

    AttrDef ad = attrdef T
    if (null ad) { 
        print "Warning: NULL attribute in attribute change trigger."
        set trigPreConPass
        halt
    }
    
    string aName = ad.name 
    if (aName ....)

Hope this helps,
Mike

Re: Doors DXL Trigger firing with multiple Attributes
Dummy1337 - Wed Sep 17 06:44:56 EDT 2014

Mike.Scharnow - Wed Sep 17 05:29:08 EDT 2014

Hello Arn,

 

We do it this way

T = trigger (triggerName, project->formal->attribute->all, pre, save, 5, triggerDxl)

and in the trigger

    AttrDef ad = attrdef T
    if (null ad) { 
        print "Warning: NULL attribute in attribute change trigger."
        set trigPreConPass
        halt
    }
    
    string aName = ad.name 
    if (aName ....)

Hope this helps,
Mike

Thank You Mike!

It works well and i do not have to handle 20 different Triggers.

Cheers,

Arn

Re: Doors DXL Trigger firing with multiple Attributes
llandale - Wed Sep 17 15:16:59 EDT 2014

Mike.Scharnow - Wed Sep 17 05:29:08 EDT 2014

Hello Arn,

 

We do it this way

T = trigger (triggerName, project->formal->attribute->all, pre, save, 5, triggerDxl)

and in the trigger

    AttrDef ad = attrdef T
    if (null ad) { 
        print "Warning: NULL attribute in attribute change trigger."
        set trigPreConPass
        halt
    }
    
    string aName = ad.name 
    if (aName ....)

Hope this helps,
Mike

Yes, far easier for the Trigger to figure it out.  You can even deploy it in the Project:

  • set(trigPreConPass)
  • Module m = module(object(t))
  • if (this is not a suitable module) then halt
  • if (this is not a suitable attribute) then halt

You can get even cleverer: er.

  • string NameTrig = name(t)
  • If NameTrig contains "ReqSpecs" then I care only about Requirement Specs
  • if NameTrig contains "TestSpecs" then I care only about Test Procedures.

You end up with a single dxl file for the trigger, and deploy it in a few triggers in the project.

-Louie